package pe.com.cotelasa.scp.entidad;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.thoughtworks.xstream.XStream;
import javax.persistence.FetchType;
 
@Entity
@Table(name = "parametro_detalle",catalog = "bdcotelasa", schema = "cotelasa")
@NamedQueries({
    @NamedQuery(name = "ParametroDetalle.findAll", query = "SELECT p FROM ParametroDetalle p"),
    @NamedQuery(name = "ParametroDetalle.findById", query = "SELECT p FROM ParametroDetalle p WHERE p.id = :id"),
    @NamedQuery(name = "ParametroDetalle.findByValNumerico", query = "SELECT p FROM ParametroDetalle p WHERE p.valNumerico = :valNumerico"),
    @NamedQuery(name = "ParametroDetalle.findByValCadena", query = "SELECT p FROM ParametroDetalle p WHERE p.valCadena = :valCadena"),
    @NamedQuery(name = "ParametroDetalle.findByValFecha", query = "SELECT p FROM ParametroDetalle p WHERE p.valFecha = :valFecha"),
    @NamedQuery(name = "ParametroDetalle.findByEstadoRegistro", query = "SELECT p FROM ParametroDetalle p WHERE p.estadoRegistro = :estadoRegistro"),
    @NamedQuery(name = "ParametroDetalle.findByDesParametroDet", query = "SELECT p FROM ParametroDetalle p WHERE p.desParametroDet = :desParametroDet")})
public class ParametroDetalle implements Serializable {
 
    private static final long serialVersionUID = -3827650840551032476L;

    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    
    @Column(name = "VAL_NUMERICO")
    private BigInteger valNumerico;
    
    @Column(name = "VAL_CADENA")
    private String valCadena;
    
    @Column(name = "VAL_FECHA")
    @Temporal(TemporalType.DATE)
    private Date valFecha;
    
    @Basic(optional = false)
    @Column(name = "ESTADO_REGISTRO")
    private char estadoRegistro;
    
    @Column(name = "DES_PARAMETRO_DET")
    private String desParametroDet;
    
    @JoinColumn(name = "ID_PARAMETRO", referencedColumnName = "ID")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Parametro parametro;
  	
    public ParametroDetalle() {
    }

    public ParametroDetalle(Integer id) {
        this.id = id;
    }

    public ParametroDetalle(Integer id, char estadoRegistro) {
        this.id = id;
        this.estadoRegistro = estadoRegistro;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigInteger getValNumerico() {
        return valNumerico;
    }

    public void setValNumerico(BigInteger valNumerico) {
        this.valNumerico = valNumerico;
    }

    public String getValCadena() {
        return valCadena;
    }

    public void setValCadena(String valCadena) {
        this.valCadena = valCadena;
    }

    public Date getValFecha() {
        return valFecha;
    }

    public void setValFecha(Date valFecha) {
        this.valFecha = valFecha;
    }

    public char getEstadoRegistro() {
        return estadoRegistro;
    }

    public void setEstadoRegistro(char estadoRegistro) {
        this.estadoRegistro = estadoRegistro;
    }

    public String getDesParametroDet() {
        return desParametroDet;
    }

    public void setDesParametroDet(String desParametroDet) {
        this.desParametroDet = desParametroDet;
    }

    public Parametro getParametro() {
        return parametro;
    }

    public void setParametro(Parametro parametro) {
        this.parametro = parametro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParametroDetalle)) {
            return false;
        }
        ParametroDetalle other = (ParametroDetalle) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        XStream xStream = new XStream();
        return xStream.toXML(this);
    }


    }
